<template>
  <div>
    <div class="row">
      <Banner />
    </div>
    <div class="row">
      <div class="col-xs-2 col-xs-offset-2">
        <div class="list-group">
          <!-- 原始 html 中我们使用a标签实现页面的跳转 -->
          <!-- <a class="list-group-item active" href="./travel.html">旅游胜地</a> -->
          <!-- <a class="list-group-item" href="./food.html">各地美食</a> -->

          <!-- Vue中借助router-link标签实现路由的切换 -->
          <router-link
            class="list-group-item"
            active-class="active"
            to="/travel"
            >旅游胜地</router-link
          >
          <router-link class="list-group-item" active-class="active" to="/food"
            >各地美食</router-link
          >
        </div>
      </div>
      <div class="col-xs-6">
        <div class="panel">
          <div class="panel-body">
            <!-- 缓存路由组件，include 属性里填写的是组件名，如果不填写，默认缓存所有；多个组件以逗号隔开 -->
            <keep-alive include="Travel,Food">
              <!-- 指定组件的呈现位置 -->
              <router-view></router-view>
            </keep-alive>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import Banner from "./components/Banner.vue";
export default {
  name: "App",
  components: { Banner },
};
</script>
